home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / include / dos.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  2KB  |  107 lines

  1. #ifndef _DOS_H_
  2. #define _DOS_H_
  3.  
  4. #include <pc.h>
  5.  
  6. union REGS {
  7.   struct {
  8.     unsigned long ax;
  9.     unsigned long bx;
  10.     unsigned long cx;
  11.     unsigned long dx;
  12.     unsigned long si;
  13.     unsigned long di;
  14.     unsigned long cflag;
  15.     unsigned long flags;
  16.   } x;
  17.   struct {
  18.     unsigned char al;
  19.     unsigned char ah;
  20.     unsigned short upper_ax;
  21.     unsigned char bl;
  22.     unsigned char bh;
  23.     unsigned short upper_bx;
  24.     unsigned char cl;
  25.     unsigned char ch;
  26.     unsigned short upper_cx;
  27.     unsigned char dl;
  28.     unsigned char dh;
  29.     unsigned short upper_dx;
  30.   } h;
  31. };
  32.  
  33. struct SREGS {
  34.   unsigned short cs;
  35.   unsigned short ds;
  36.   unsigned short es;
  37.   unsigned short fs;
  38.   unsigned short gs;
  39.   unsigned short ss;
  40. };
  41.  
  42. struct ftime {
  43.   unsigned ft_tsec:5;    /* 0-29, double to get real seconds */
  44.   unsigned ft_min:6;    /* 0-59 */
  45.   unsigned ft_hour:5;    /* 0-23 */
  46.   unsigned ft_day:5;    /* 1-31 */
  47.   unsigned ft_month:4;    /* 1-12 */
  48.   unsigned ft_year:7;    /* since 1980 */
  49. };
  50.  
  51. struct date {
  52.   short da_year;
  53.   char  da_day;
  54.   char  da_mon;
  55. };
  56.  
  57. struct time {
  58.   unsigned char ti_min;
  59.   unsigned char ti_hour;
  60.   unsigned char ti_hund;
  61.   unsigned char ti_sec;
  62. };
  63.  
  64. struct dfree {
  65.   unsigned df_avail;
  66.   unsigned df_total;
  67.   unsigned df_bsec;
  68.   unsigned df_sclus;
  69. };
  70.  
  71. #ifdef __cplusplus
  72. extern "C" {
  73. #endif
  74.  
  75. int bdos(int func, unsigned dx, unsigned al);
  76. int bdosptr(int func, void *dx, unsigned al);
  77. int int86(int ivec, union REGS *in, union REGS *out);
  78. int int86x(int ivec, union REGS *in, union REGS *out, struct SREGS *seg);
  79. int intdos(union REGS *in, union REGS *out);
  80. int intdosx(union REGS *in, union REGS *out, struct SREGS *seg);
  81.  
  82. int enable(void);
  83. int disable(void);
  84.  
  85. int getftime(int handle, struct ftime *ftimep);
  86. int setftime(int handle, struct ftime *ftimep);
  87.  
  88. int getcbrk(void);
  89. int setcbrk(int new_value);
  90.  
  91. void getdate(struct date *);
  92. void gettime(struct time *);
  93. void setdate(struct date *);
  94. void settime(struct time *);
  95.  
  96. void getdfree(unsigned char drive, struct dfree *ptr);
  97.  
  98. void delay(unsigned msec);
  99. int _get_default_drive(void);
  100. void _fixpath(const char *, char *);
  101.  
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105.  
  106. #endif
  107.